//////////////////////////////////////////////////
// glParticleManager.h
//
// Author: Tarik Belabbas et Adrien Hoffer
//////////////////////////////////////////////////

#ifndef GLPARTICLEMANAGER_H_
#define GLPARTICLEMANAGER_H_

#include <map>
#include "../common/Common.h"
#include "glParticleEmitter.h"

class glParticleManager
{
	ST_DECLARE_SINGLETON( glParticleManager );

public:
	glParticleManager();
	~glParticleManager();

	unsigned int	addEmitter			();
	void			initialize			( unsigned int _emitterId );
	void			render				();

	void		addTexture		( unsigned int _emitterId, const char* _texturePath );

	void		setPosition		( unsigned int _emitterId, const glm::vec3& _position );
	void		setDirection	( unsigned int _emitterId, const glm::vec3& _direction );
	void		setNbParticles	( unsigned int _emitterId, unsigned int _nbParticles );

	void		setAdvectVS		( unsigned int _emitterId, const char* _advectVS );
	void		setRenderVS		( unsigned int _emitterId, const char* _renderVS );
	void		setRenderFS		( unsigned int _emitterId, const char* _renderFS );

private:

	glParticleEmitter*	getEmitter( unsigned int _emitterId );

	unsigned int	m_emitterId;
	unsigned int	m_previousTime;

	std::map< unsigned int, glParticleEmitter* > m_emitters;
};

#endif /* GLPARTICLEMANAGER_H_ */
